.class public Lcom/felhr/usbserial/FTDISerialDevice;
.super Lcom/felhr/usbserial/UsbSerialDevice;
.source "FTDISerialDevice.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/felhr/usbserial/FTDISerialDevice$FTDIUtilities;
    }
.end annotation


# static fields
.field private static final CLASS_ID:Ljava/lang/String; = "FTDISerialDevice"


# instance fields
.field private breakCallback:Lcom/felhr/usbserial/UsbSerialInterface$UsbBreakCallback;

.field private ctsCallback:Lcom/felhr/usbserial/UsbSerialInterface$UsbCTSCallback;

.field private ctsState:Z

.field private currentSioSetData:I

.field private dsrCallback:Lcom/felhr/usbserial/UsbSerialInterface$UsbDSRCallback;

.field private dsrState:Z

.field private dtrDsrEnabled:Z

.field private firstTime:Z

.field private frameCallback:Lcom/felhr/usbserial/UsbSerialInterface$UsbFrameCallback;

.field public ftdiUtilities:Lcom/felhr/usbserial/FTDISerialDevice$FTDIUtilities;

.field private inEndpoint:Landroid/hardware/usb/UsbEndpoint;

.field private mInterface:Landroid/hardware/usb/UsbInterface;

.field private outEndpoint:Landroid/hardware/usb/UsbEndpoint;

.field private overrunCallback:Lcom/felhr/usbserial/UsbSerialInterface$UsbOverrunCallback;

.field private parityCallback:Lcom/felhr/usbserial/UsbSerialInterface$UsbParityCallback;

.field private requestIN:Landroid/hardware/usb/UsbRequest;

.field private rtsCtsEnabled:Z


# direct methods
.method public constructor <init>(Landroid/hardware/usb/UsbDevice;Landroid/hardware/usb/UsbDeviceConnection;I)V
    .locals 1

    .line 100
    invoke-direct {p0, p1, p2}, Lcom/felhr/usbserial/UsbSerialDevice;-><init>(Landroid/hardware/usb/UsbDevice;Landroid/hardware/usb/UsbDeviceConnection;)V

    const/4 p2, 0x0

    .line 65
    iput p2, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 101
    new-instance v0, Lcom/felhr/usbserial/FTDISerialDevice$FTDIUtilities;

    invoke-direct {v0, p0}, Lcom/felhr/usbserial/FTDISerialDevice$FTDIUtilities;-><init>(Lcom/felhr/usbserial/FTDISerialDevice;)V

    iput-object v0, p0, Lcom/felhr/usbserial/FTDISerialDevice;->ftdiUtilities:Lcom/felhr/usbserial/FTDISerialDevice$FTDIUtilities;

    .line 102
    iput-boolean p2, p0, Lcom/felhr/usbserial/FTDISerialDevice;->rtsCtsEnabled:Z

    .line 103
    iput-boolean p2, p0, Lcom/felhr/usbserial/FTDISerialDevice;->dtrDsrEnabled:Z

    const/4 v0, 0x1

    .line 104
    iput-boolean v0, p0, Lcom/felhr/usbserial/FTDISerialDevice;->ctsState:Z

    .line 105
    iput-boolean v0, p0, Lcom/felhr/usbserial/FTDISerialDevice;->dsrState:Z

    .line 106
    iput-boolean v0, p0, Lcom/felhr/usbserial/FTDISerialDevice;->firstTime:Z

    if-ltz p3, :cond_0

    move p2, p3

    .line 107
    :cond_0
    invoke-virtual {p1, p2}, Landroid/hardware/usb/UsbDevice;->getInterface(I)Landroid/hardware/usb/UsbInterface;

    move-result-object p1

    iput-object p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->mInterface:Landroid/hardware/usb/UsbInterface;

    return-void
.end method

.method static synthetic access$000(Lcom/felhr/usbserial/FTDISerialDevice;)Z
    .locals 0

    .line 13
    iget-boolean p0, p0, Lcom/felhr/usbserial/FTDISerialDevice;->firstTime:Z

    return p0
.end method

.method static synthetic access$002(Lcom/felhr/usbserial/FTDISerialDevice;Z)Z
    .locals 0

    .line 13
    iput-boolean p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->firstTime:Z

    return p1
.end method

.method static synthetic access$100(Lcom/felhr/usbserial/FTDISerialDevice;)Z
    .locals 0

    .line 13
    iget-boolean p0, p0, Lcom/felhr/usbserial/FTDISerialDevice;->ctsState:Z

    return p0
.end method

.method static synthetic access$1000(Lcom/felhr/usbserial/FTDISerialDevice;)Lcom/felhr/usbserial/UsbSerialInterface$UsbBreakCallback;
    .locals 0

    .line 13
    iget-object p0, p0, Lcom/felhr/usbserial/FTDISerialDevice;->breakCallback:Lcom/felhr/usbserial/UsbSerialInterface$UsbBreakCallback;

    return-object p0
.end method

.method static synthetic access$102(Lcom/felhr/usbserial/FTDISerialDevice;Z)Z
    .locals 0

    .line 13
    iput-boolean p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->ctsState:Z

    return p1
.end method

.method static synthetic access$200(Lcom/felhr/usbserial/FTDISerialDevice;)Z
    .locals 0

    .line 13
    iget-boolean p0, p0, Lcom/felhr/usbserial/FTDISerialDevice;->dsrState:Z

    return p0
.end method

.method static synthetic access$202(Lcom/felhr/usbserial/FTDISerialDevice;Z)Z
    .locals 0

    .line 13
    iput-boolean p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->dsrState:Z

    return p1
.end method

.method static synthetic access$300(Lcom/felhr/usbserial/FTDISerialDevice;)Z
    .locals 0

    .line 13
    iget-boolean p0, p0, Lcom/felhr/usbserial/FTDISerialDevice;->rtsCtsEnabled:Z

    return p0
.end method

.method static synthetic access$400(Lcom/felhr/usbserial/FTDISerialDevice;)Lcom/felhr/usbserial/UsbSerialInterface$UsbCTSCallback;
    .locals 0

    .line 13
    iget-object p0, p0, Lcom/felhr/usbserial/FTDISerialDevice;->ctsCallback:Lcom/felhr/usbserial/UsbSerialInterface$UsbCTSCallback;

    return-object p0
.end method

.method static synthetic access$500(Lcom/felhr/usbserial/FTDISerialDevice;)Z
    .locals 0

    .line 13
    iget-boolean p0, p0, Lcom/felhr/usbserial/FTDISerialDevice;->dtrDsrEnabled:Z

    return p0
.end method

.method static synthetic access$600(Lcom/felhr/usbserial/FTDISerialDevice;)Lcom/felhr/usbserial/UsbSerialInterface$UsbDSRCallback;
    .locals 0

    .line 13
    iget-object p0, p0, Lcom/felhr/usbserial/FTDISerialDevice;->dsrCallback:Lcom/felhr/usbserial/UsbSerialInterface$UsbDSRCallback;

    return-object p0
.end method

.method static synthetic access$700(Lcom/felhr/usbserial/FTDISerialDevice;)Lcom/felhr/usbserial/UsbSerialInterface$UsbParityCallback;
    .locals 0

    .line 13
    iget-object p0, p0, Lcom/felhr/usbserial/FTDISerialDevice;->parityCallback:Lcom/felhr/usbserial/UsbSerialInterface$UsbParityCallback;

    return-object p0
.end method

.method static synthetic access$800(Lcom/felhr/usbserial/FTDISerialDevice;)Lcom/felhr/usbserial/UsbSerialInterface$UsbFrameCallback;
    .locals 0

    .line 13
    iget-object p0, p0, Lcom/felhr/usbserial/FTDISerialDevice;->frameCallback:Lcom/felhr/usbserial/UsbSerialInterface$UsbFrameCallback;

    return-object p0
.end method

.method static synthetic access$900(Lcom/felhr/usbserial/FTDISerialDevice;)Lcom/felhr/usbserial/UsbSerialInterface$UsbOverrunCallback;
    .locals 0

    .line 13
    iget-object p0, p0, Lcom/felhr/usbserial/FTDISerialDevice;->overrunCallback:Lcom/felhr/usbserial/UsbSerialInterface$UsbOverrunCallback;

    return-object p0
.end method

.method private openFTDI()Z
    .locals 7

    .line 425
    iget-object v0, p0, Lcom/felhr/usbserial/UsbSerialDevice;->connection:Landroid/hardware/usb/UsbDeviceConnection;

    iget-object v1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->mInterface:Landroid/hardware/usb/UsbInterface;

    const/4 v2, 0x1

    invoke-virtual {v0, v1, v2}, Landroid/hardware/usb/UsbDeviceConnection;->claimInterface(Landroid/hardware/usb/UsbInterface;Z)Z

    move-result v0

    const/4 v1, 0x0

    if-eqz v0, :cond_8

    .line 427
    sget-object v0, Lcom/felhr/usbserial/FTDISerialDevice;->CLASS_ID:Ljava/lang/String;

    const-string v3, "Interface succesfully claimed"

    invoke-static {v0, v3}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 435
    iget-object v0, p0, Lcom/felhr/usbserial/FTDISerialDevice;->mInterface:Landroid/hardware/usb/UsbInterface;

    invoke-virtual {v0}, Landroid/hardware/usb/UsbInterface;->getEndpointCount()I

    move-result v0

    const/4 v3, 0x0

    :goto_0
    add-int/lit8 v4, v0, -0x1

    const/4 v5, 0x2

    if-gt v3, v4, :cond_1

    .line 438
    iget-object v4, p0, Lcom/felhr/usbserial/FTDISerialDevice;->mInterface:Landroid/hardware/usb/UsbInterface;

    invoke-virtual {v4, v3}, Landroid/hardware/usb/UsbInterface;->getEndpoint(I)Landroid/hardware/usb/UsbEndpoint;

    move-result-object v4

    .line 439
    invoke-virtual {v4}, Landroid/hardware/usb/UsbEndpoint;->getType()I

    move-result v6

    if-ne v6, v5, :cond_0

    .line 440
    invoke-virtual {v4}, Landroid/hardware/usb/UsbEndpoint;->getDirection()I

    move-result v5

    const/16 v6, 0x80

    if-ne v5, v6, :cond_0

    .line 442
    iput-object v4, p0, Lcom/felhr/usbserial/FTDISerialDevice;->inEndpoint:Landroid/hardware/usb/UsbEndpoint;

    goto :goto_1

    .line 445
    :cond_0
    iput-object v4, p0, Lcom/felhr/usbserial/FTDISerialDevice;->outEndpoint:Landroid/hardware/usb/UsbEndpoint;

    :goto_1
    add-int/lit8 v3, v3, 0x1

    goto :goto_0

    .line 450
    :cond_1
    iput-boolean v2, p0, Lcom/felhr/usbserial/FTDISerialDevice;->firstTime:Z

    const/4 v0, 0x0

    .line 451
    invoke-direct {p0, v1, v1, v1, v0}, Lcom/felhr/usbserial/FTDISerialDevice;->setControlCommand(III[B)I

    move-result v3

    if-gez v3, :cond_2

    return v1

    :cond_2
    const/4 v3, 0x4

    const/16 v4, 0x8

    .line 453
    invoke-direct {p0, v3, v4, v1, v0}, Lcom/felhr/usbserial/FTDISerialDevice;->setControlCommand(III[B)I

    move-result v3

    if-gez v3, :cond_3

    return v1

    .line 455
    :cond_3
    iput v4, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    const/16 v3, 0x101

    .line 456
    invoke-direct {p0, v2, v3, v1, v0}, Lcom/felhr/usbserial/FTDISerialDevice;->setControlCommand(III[B)I

    move-result v3

    if-gez v3, :cond_4

    return v1

    :cond_4
    const/16 v3, 0x202

    .line 458
    invoke-direct {p0, v2, v3, v1, v0}, Lcom/felhr/usbserial/FTDISerialDevice;->setControlCommand(III[B)I

    move-result v3

    if-gez v3, :cond_5

    return v1

    .line 460
    :cond_5
    invoke-direct {p0, v5, v1, v1, v0}, Lcom/felhr/usbserial/FTDISerialDevice;->setControlCommand(III[B)I

    move-result v3

    if-gez v3, :cond_6

    return v1

    :cond_6
    const/4 v3, 0x3

    const/16 v4, 0x4138

    .line 462
    invoke-direct {p0, v3, v4, v1, v0}, Lcom/felhr/usbserial/FTDISerialDevice;->setControlCommand(III[B)I

    move-result v0

    if-gez v0, :cond_7

    return v1

    .line 466
    :cond_7
    iput-boolean v1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->rtsCtsEnabled:Z

    .line 467
    iput-boolean v1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->dtrDsrEnabled:Z

    return v2

    .line 430
    :cond_8
    sget-object v0, Lcom/felhr/usbserial/FTDISerialDevice;->CLASS_ID:Ljava/lang/String;

    const-string v2, "Interface could not be claimed"

    invoke-static {v0, v2}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    return v1
.end method

.method private setControlCommand(III[B)I
    .locals 9

    if-eqz p4, :cond_0

    .line 477
    array-length v0, p4

    move v7, v0

    goto :goto_0

    :cond_0
    const/4 v0, 0x0

    const/4 v7, 0x0

    .line 479
    :goto_0
    iget-object v1, p0, Lcom/felhr/usbserial/UsbSerialDevice;->connection:Landroid/hardware/usb/UsbDeviceConnection;

    const/16 v2, 0x40

    iget-object v0, p0, Lcom/felhr/usbserial/FTDISerialDevice;->mInterface:Landroid/hardware/usb/UsbInterface;

    invoke-virtual {v0}, Landroid/hardware/usb/UsbInterface;->getId()I

    move-result v0

    add-int/lit8 v0, v0, 0x1

    add-int v5, v0, p3

    const/16 v8, 0x1388

    move v3, p1

    move v4, p2

    move-object v6, p4

    invoke-virtual/range {v1 .. v8}, Landroid/hardware/usb/UsbDeviceConnection;->controlTransfer(IIII[BII)I

    move-result p1

    .line 480
    sget-object p2, Lcom/felhr/usbserial/FTDISerialDevice;->CLASS_ID:Ljava/lang/String;

    new-instance p3, Ljava/lang/StringBuilder;

    invoke-direct {p3}, Ljava/lang/StringBuilder;-><init>()V

    const-string p4, "Control Transfer Response: "

    invoke-virtual {p3, p4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-static {p1}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object p4

    invoke-virtual {p3, p4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {p3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p3

    invoke-static {p2, p3}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    return p1
.end method


# virtual methods
.method public close()V
    .locals 4

    const/4 v0, 0x0

    const/4 v1, 0x1

    const/4 v2, 0x0

    const/16 v3, 0x100

    .line 140
    invoke-direct {p0, v1, v3, v2, v0}, Lcom/felhr/usbserial/FTDISerialDevice;->setControlCommand(III[B)I

    const/16 v3, 0x200

    .line 141
    invoke-direct {p0, v1, v3, v2, v0}, Lcom/felhr/usbserial/FTDISerialDevice;->setControlCommand(III[B)I

    .line 142
    iput v2, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 143
    invoke-virtual {p0}, Lcom/felhr/usbserial/UsbSerialDevice;->killWorkingThread()V

    .line 144
    invoke-virtual {p0}, Lcom/felhr/usbserial/UsbSerialDevice;->killWriteThread()V

    .line 145
    iget-object v0, p0, Lcom/felhr/usbserial/UsbSerialDevice;->connection:Landroid/hardware/usb/UsbDeviceConnection;

    iget-object v1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->mInterface:Landroid/hardware/usb/UsbInterface;

    invoke-virtual {v0, v1}, Landroid/hardware/usb/UsbDeviceConnection;->releaseInterface(Landroid/hardware/usb/UsbInterface;)Z

    return-void
.end method

.method public getBreak(Lcom/felhr/usbserial/UsbSerialInterface$UsbBreakCallback;)V
    .locals 0

    .line 402
    iput-object p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->breakCallback:Lcom/felhr/usbserial/UsbSerialInterface$UsbBreakCallback;

    return-void
.end method

.method public open()Z
    .locals 3

    .line 113
    invoke-direct {p0}, Lcom/felhr/usbserial/FTDISerialDevice;->openFTDI()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 118
    new-instance v0, Landroid/hardware/usb/UsbRequest;

    invoke-direct {v0}, Landroid/hardware/usb/UsbRequest;-><init>()V

    iput-object v0, p0, Lcom/felhr/usbserial/FTDISerialDevice;->requestIN:Landroid/hardware/usb/UsbRequest;

    .line 119
    iget-object v0, p0, Lcom/felhr/usbserial/FTDISerialDevice;->requestIN:Landroid/hardware/usb/UsbRequest;

    iget-object v1, p0, Lcom/felhr/usbserial/UsbSerialDevice;->connection:Landroid/hardware/usb/UsbDeviceConnection;

    iget-object v2, p0, Lcom/felhr/usbserial/FTDISerialDevice;->inEndpoint:Landroid/hardware/usb/UsbEndpoint;

    invoke-virtual {v0, v1, v2}, Landroid/hardware/usb/UsbRequest;->initialize(Landroid/hardware/usb/UsbDeviceConnection;Landroid/hardware/usb/UsbEndpoint;)Z

    .line 122
    invoke-virtual {p0}, Lcom/felhr/usbserial/UsbSerialDevice;->restartWorkingThread()V

    .line 123
    invoke-virtual {p0}, Lcom/felhr/usbserial/UsbSerialDevice;->restartWriteThread()V

    .line 126
    iget-object v0, p0, Lcom/felhr/usbserial/FTDISerialDevice;->requestIN:Landroid/hardware/usb/UsbRequest;

    iget-object v1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->outEndpoint:Landroid/hardware/usb/UsbEndpoint;

    invoke-virtual {p0, v0, v1}, Lcom/felhr/usbserial/UsbSerialDevice;->setThreadsParams(Landroid/hardware/usb/UsbRequest;Landroid/hardware/usb/UsbEndpoint;)V

    const/4 v0, 0x1

    .line 128
    iput-boolean v0, p0, Lcom/felhr/usbserial/UsbSerialDevice;->asyncMode:Z

    return v0

    :cond_0
    const/4 v0, 0x0

    return v0
.end method

.method public setBaudRate(I)V
    .locals 4

    const v0, 0x8003

    const/16 v1, 0x4138

    const/16 v2, 0x12c

    if-ltz p1, :cond_0

    if-gt p1, v2, :cond_0

    const/16 v0, 0x2710

    goto/16 :goto_0

    :cond_0
    const/16 v3, 0x258

    if-le p1, v2, :cond_1

    if-gt p1, v3, :cond_1

    const/16 v0, 0x1388

    goto/16 :goto_0

    :cond_1
    const/16 v2, 0x4b0

    if-le p1, v3, :cond_2

    if-gt p1, v2, :cond_2

    const/16 v0, 0x9c4

    goto/16 :goto_0

    :cond_2
    const/16 v3, 0x960

    if-le p1, v2, :cond_3

    if-gt p1, v3, :cond_3

    const/16 v0, 0x4e2

    goto/16 :goto_0

    :cond_3
    const/16 v2, 0x12c0

    if-le p1, v3, :cond_4

    if-gt p1, v2, :cond_4

    const/16 v0, 0x271

    goto :goto_0

    :cond_4
    const/16 v3, 0x2580

    if-le p1, v2, :cond_6

    if-gt p1, v3, :cond_6

    :cond_5
    const/16 v0, 0x4138

    goto :goto_0

    :cond_6
    const/16 v2, 0x4b00

    if-le p1, v3, :cond_7

    if-gt p1, v2, :cond_7

    const v0, 0x809c

    goto :goto_0

    :cond_7
    if-le p1, v2, :cond_8

    const v3, 0x9600

    if-gt p1, v3, :cond_8

    const v0, 0xc04e

    goto :goto_0

    :cond_8
    const v3, 0xe100

    if-le p1, v2, :cond_9

    if-gt p1, v3, :cond_9

    const/16 v0, 0x34

    goto :goto_0

    :cond_9
    const v2, 0x1c200

    if-le p1, v3, :cond_a

    if-gt p1, v2, :cond_a

    const/16 v0, 0x1a

    goto :goto_0

    :cond_a
    const v3, 0x38400

    if-le p1, v2, :cond_b

    if-gt p1, v3, :cond_b

    const/16 v0, 0xd

    goto :goto_0

    :cond_b
    const v2, 0x70800

    if-le p1, v3, :cond_c

    if-gt p1, v2, :cond_c

    const/16 v0, 0x4006

    goto :goto_0

    :cond_c
    const v3, 0xe1000

    if-le p1, v2, :cond_d

    if-gt p1, v3, :cond_d

    goto :goto_0

    :cond_d
    if-le p1, v3, :cond_5

    :goto_0
    const/4 p1, 0x3

    const/4 v1, 0x0

    const/4 v2, 0x0

    .line 206
    invoke-direct {p0, p1, v0, v1, v2}, Lcom/felhr/usbserial/FTDISerialDevice;->setControlCommand(III[B)I

    return-void
.end method

.method public setDataBits(I)V
    .locals 4

    const/4 v0, 0x5

    const/4 v1, 0x0

    const/4 v2, 0x0

    const/4 v3, 0x4

    if-eq p1, v0, :cond_3

    const/4 v0, 0x6

    if-eq p1, v0, :cond_2

    const/4 v0, 0x7

    if-eq p1, v0, :cond_1

    const/16 v0, 0x8

    if-eq p1, v0, :cond_0

    .line 243
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    and-int/lit8 p1, p1, -0x2

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 244
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    and-int/lit8 p1, p1, -0x3

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 245
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    and-int/lit8 p1, p1, -0x5

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 246
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    or-int/2addr p1, v0

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 247
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    invoke-direct {p0, v3, p1, v2, v1}, Lcom/felhr/usbserial/FTDISerialDevice;->setControlCommand(III[B)I

    goto :goto_0

    .line 236
    :cond_0
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    and-int/lit8 p1, p1, -0x2

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 237
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    and-int/lit8 p1, p1, -0x3

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 238
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    and-int/lit8 p1, p1, -0x5

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 239
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    or-int/2addr p1, v0

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 240
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    invoke-direct {p0, v3, p1, v2, v1}, Lcom/felhr/usbserial/FTDISerialDevice;->setControlCommand(III[B)I

    goto :goto_0

    .line 229
    :cond_1
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    or-int/lit8 p1, p1, 0x1

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 230
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    or-int/lit8 p1, p1, 0x2

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 231
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    or-int/2addr p1, v3

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 232
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    and-int/lit8 p1, p1, -0x9

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 233
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    invoke-direct {p0, v3, p1, v2, v1}, Lcom/felhr/usbserial/FTDISerialDevice;->setControlCommand(III[B)I

    goto :goto_0

    .line 222
    :cond_2
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    and-int/lit8 p1, p1, -0x2

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 223
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    or-int/lit8 p1, p1, 0x2

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 224
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    or-int/2addr p1, v3

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 225
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    and-int/lit8 p1, p1, -0x9

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 226
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    invoke-direct {p0, v3, p1, v2, v1}, Lcom/felhr/usbserial/FTDISerialDevice;->setControlCommand(III[B)I

    goto :goto_0

    .line 215
    :cond_3
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    or-int/lit8 p1, p1, 0x1

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 216
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    and-int/lit8 p1, p1, -0x3

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 217
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    or-int/2addr p1, v3

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 218
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    and-int/lit8 p1, p1, -0x9

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 219
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    invoke-direct {p0, v3, p1, v2, v1}, Lcom/felhr/usbserial/FTDISerialDevice;->setControlCommand(III[B)I

    :goto_0
    return-void
.end method

.method public setFlowControl(I)V
    .locals 4

    const/4 v0, 0x0

    const/4 v1, 0x2

    const/4 v2, 0x0

    if-eqz p1, :cond_3

    const/4 v3, 0x1

    if-eq p1, v3, :cond_2

    if-eq p1, v1, :cond_1

    const/4 v3, 0x3

    if-eq p1, v3, :cond_0

    .line 358
    invoke-direct {p0, v1, v2, v2, v0}, Lcom/felhr/usbserial/FTDISerialDevice;->setControlCommand(III[B)I

    goto :goto_0

    :cond_0
    const/4 p1, 0x4

    const/16 v2, 0x1311

    .line 355
    invoke-direct {p0, v1, v2, p1, v0}, Lcom/felhr/usbserial/FTDISerialDevice;->setControlCommand(III[B)I

    goto :goto_0

    .line 347
    :cond_1
    iput-boolean v3, p0, Lcom/felhr/usbserial/FTDISerialDevice;->dtrDsrEnabled:Z

    .line 348
    iput-boolean v2, p0, Lcom/felhr/usbserial/FTDISerialDevice;->rtsCtsEnabled:Z

    .line 350
    invoke-direct {p0, v1, v2, v1, v0}, Lcom/felhr/usbserial/FTDISerialDevice;->setControlCommand(III[B)I

    goto :goto_0

    .line 341
    :cond_2
    iput-boolean v3, p0, Lcom/felhr/usbserial/FTDISerialDevice;->rtsCtsEnabled:Z

    .line 342
    iput-boolean v2, p0, Lcom/felhr/usbserial/FTDISerialDevice;->dtrDsrEnabled:Z

    .line 344
    invoke-direct {p0, v1, v2, v3, v0}, Lcom/felhr/usbserial/FTDISerialDevice;->setControlCommand(III[B)I

    goto :goto_0

    .line 336
    :cond_3
    invoke-direct {p0, v1, v2, v2, v0}, Lcom/felhr/usbserial/FTDISerialDevice;->setControlCommand(III[B)I

    .line 337
    iput-boolean v2, p0, Lcom/felhr/usbserial/FTDISerialDevice;->rtsCtsEnabled:Z

    .line 338
    iput-boolean v2, p0, Lcom/felhr/usbserial/FTDISerialDevice;->dtrDsrEnabled:Z

    :goto_0
    return-void
.end method

.method public setParity(I)V
    .locals 4

    const/4 v0, 0x0

    const/4 v1, 0x0

    const/4 v2, 0x4

    if-eqz p1, :cond_4

    const/4 v3, 0x1

    if-eq p1, v3, :cond_3

    const/4 v3, 0x2

    if-eq p1, v3, :cond_2

    const/4 v3, 0x3

    if-eq p1, v3, :cond_1

    if-eq p1, v2, :cond_0

    .line 321
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    and-int/lit16 p1, p1, -0x101

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 322
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    and-int/lit16 p1, p1, -0x201

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 323
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    and-int/lit16 p1, p1, -0x401

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 324
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    invoke-direct {p0, v2, p1, v1, v0}, Lcom/felhr/usbserial/FTDISerialDevice;->setControlCommand(III[B)I

    goto/16 :goto_0

    .line 315
    :cond_0
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    and-int/lit16 p1, p1, -0x101

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 316
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    and-int/lit16 p1, p1, -0x201

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 317
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    or-int/lit16 p1, p1, 0x400

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 318
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    invoke-direct {p0, v2, p1, v1, v0}, Lcom/felhr/usbserial/FTDISerialDevice;->setControlCommand(III[B)I

    goto :goto_0

    .line 309
    :cond_1
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    or-int/lit16 p1, p1, 0x100

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 310
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    or-int/lit16 p1, p1, 0x200

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 311
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    and-int/lit16 p1, p1, -0x401

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 312
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    invoke-direct {p0, v2, p1, v1, v0}, Lcom/felhr/usbserial/FTDISerialDevice;->setControlCommand(III[B)I

    goto :goto_0

    .line 303
    :cond_2
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    and-int/lit16 p1, p1, -0x101

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 304
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    or-int/lit16 p1, p1, 0x200

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 305
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    and-int/lit16 p1, p1, -0x401

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 306
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    invoke-direct {p0, v2, p1, v1, v0}, Lcom/felhr/usbserial/FTDISerialDevice;->setControlCommand(III[B)I

    goto :goto_0

    .line 297
    :cond_3
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    or-int/lit16 p1, p1, 0x100

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 298
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    and-int/lit16 p1, p1, -0x201

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 299
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    and-int/lit16 p1, p1, -0x401

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 300
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    invoke-direct {p0, v2, p1, v1, v0}, Lcom/felhr/usbserial/FTDISerialDevice;->setControlCommand(III[B)I

    goto :goto_0

    .line 291
    :cond_4
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    and-int/lit16 p1, p1, -0x101

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 292
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    and-int/lit16 p1, p1, -0x201

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 293
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    and-int/lit16 p1, p1, -0x401

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 294
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    invoke-direct {p0, v2, p1, v1, v0}, Lcom/felhr/usbserial/FTDISerialDevice;->setControlCommand(III[B)I

    :goto_0
    return-void
.end method

.method public setStopBits(I)V
    .locals 4

    const/4 v0, 0x1

    const/4 v1, 0x0

    const/4 v2, 0x0

    const/4 v3, 0x4

    if-eq p1, v0, :cond_2

    const/4 v0, 0x2

    if-eq p1, v0, :cond_1

    const/4 v0, 0x3

    if-eq p1, v0, :cond_0

    .line 277
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    and-int/lit16 p1, p1, -0x801

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 278
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    and-int/lit16 p1, p1, -0x1001

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 279
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    and-int/lit16 p1, p1, -0x2001

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 280
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    invoke-direct {p0, v3, p1, v2, v1}, Lcom/felhr/usbserial/FTDISerialDevice;->setControlCommand(III[B)I

    goto :goto_0

    .line 265
    :cond_0
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    or-int/lit16 p1, p1, 0x800

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 266
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    and-int/lit16 p1, p1, -0x1001

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 267
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    and-int/lit16 p1, p1, -0x2001

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 268
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    invoke-direct {p0, v3, p1, v2, v1}, Lcom/felhr/usbserial/FTDISerialDevice;->setControlCommand(III[B)I

    goto :goto_0

    .line 271
    :cond_1
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    and-int/lit16 p1, p1, -0x801

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 272
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    or-int/lit16 p1, p1, 0x1000

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 273
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    and-int/lit16 p1, p1, -0x2001

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 274
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    invoke-direct {p0, v3, p1, v2, v1}, Lcom/felhr/usbserial/FTDISerialDevice;->setControlCommand(III[B)I

    goto :goto_0

    .line 259
    :cond_2
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    and-int/lit16 p1, p1, -0x801

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 260
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    and-int/lit16 p1, p1, -0x1001

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 261
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    and-int/lit16 p1, p1, -0x2001

    iput p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    .line 262
    iget p1, p0, Lcom/felhr/usbserial/FTDISerialDevice;->currentSioSetData:I

    invoke-direct {p0, v3, p1, v2, v1}, Lcom/felhr/usbserial/FTDISerialDevice;->setControlCommand(III[B)I

    :goto_0
    return-void
.end method
